﻿Public Class list
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Request.Params("Name") = "" Then
            GridView1.DataSourceID = "SqlDataSource1"
        Else
            GridView1.DataSourceID = "SqlDataSource2"
        End If
    End Sub

    Protected Function getDate(ByVal dateTime As String) As String
        If (dateTime = "") Then
            Return "Not Published"
        Else
            Dim parts As String() = dateTime.Split(" ")
            Return parts(0)
        End If
    End Function

    Protected Sub btn_Serach_Click(sender As Object, e As EventArgs) Handles btn_Serach.Click
        If tb_GName.Text <> "" Then
            Response.Redirect("list.aspx?Name=" & tb_GName.Text)
        End If
    End Sub
End Class